package com.xiashitech.agent.instrumentation.struts2;

import io.opentelemetry.javaagent.shaded.instrumentation.api.instrumenter.Instrumenter;
import io.opentelemetry.javaagent.shaded.io.opentelemetry.api.GlobalOpenTelemetry;
public class XSStruts2ActionSingletons {
    private XSStruts2ActionSingletons() {}
    private static final String INSTRUMENTATION_NAME = "com.xiashitech.struts2.action";
    private static final String SPAN_NAME = "xs.struts2action";
    private static final Instrumenter<Object, Object> INSTRUMENTER;
    public static Instrumenter<Object, Object> instrumenter() {
        return INSTRUMENTER;
    }

    static {
        INSTRUMENTER =
                Instrumenter.<Object, Object>builder(
                                GlobalOpenTelemetry.get(),
                                INSTRUMENTATION_NAME,
                                request -> SPAN_NAME
                        ).addAttributesExtractor(new XSStruts2ActionAttributesExtractor())
                        .buildInstrumenter();
    }
}
